package cn.com.cifi.mars.web.action.report;

import cn.com.cifi.mars.bean.vo.report.CityReturnCoefficientReportVo;
import cn.com.cifi.mars.bean.vo.report.ProjectReturnCoefficientReportVo;
import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.common.constants.VersionConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author: JingYuanXiang
 * @date: 2020/12/14 16:16
 */
@Api(tags = "报表API")
@RequestMapping("/${spring.data.rest.base-path}/{apiVersion}/report")
public interface IReturnCoefficientReportController {

    @ApiOperation(value = "手动刷新项目回款系数分析表", notes = "手动刷新项目回款系数分析表数据\n"+
            "v1 : 指定年月,全量刷新\n" +
            "v2 : 指定年月,指定项目,刷新")
    @GetMapping(value = "refreshdmProjectReturnCoefficient")
    R refreshdmProjectReturnCoefficient(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "项目Id", required = false) @RequestParam(value = "projectId",required = false) String projectId,
            @ApiParam(value = "年月", required = true) @RequestParam String yearMonth);

    @ApiOperation(value = "查询项目回款系数分析表", notes = "查询项目回款系数分析表")
    @GetMapping(value = "dmProjectReturnCoefficient")
    R<List<ProjectReturnCoefficientReportVo>> dmProjectReturnCoefficient(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "截止年月", required = true) @RequestParam String yearMonth,
            @ApiParam(value = "版本类型", required = true) @RequestParam String versionType,
            @ApiParam(value = "对比版本类型", required = true) @RequestParam String vsVersionType);


    @ApiOperation(value = "导出项目回款系数分析表", notes = "导出项目回款系数分析表")
    @GetMapping(value = "exportProjectReturnCoefficient")
    void exportProjectReturnCoefficient(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            HttpServletResponse response,
            @ApiParam(value = "截止年月", required = true) @RequestParam String yearMonth);



    @ApiOperation(value = "手动刷新城市回款系数分析表", notes = "手动刷新城市回款系数分析表\n"+
            "v1 : 指定年月,全量刷新\n" +
            "v2 : 指定年月,指定城市刷新")
    @GetMapping(value = "refreshDmCityReturnCoefficient")
    R refreshDmCityReturnCoefficient(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "城市Id", required = false) @RequestParam(value = "cityId",required = false) String cityId,
            @ApiParam(value = "年月", required = true) @RequestParam String yearMonth);

    @ApiOperation(value = "查询城市回款系数表", notes = "查询城市回款系数表")
    @GetMapping(value = "dmCityReturnCoefficient")
    R<List<CityReturnCoefficientReportVo>> dmCityReturnCoefficient(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "截止年月", required = true) @RequestParam String yearMonth);

    @ApiOperation(value = "导出城市回款系数表", notes = "导出城市回款系数表")
    @GetMapping(value = "exportCityReturn")
    void exportCityReturn(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            HttpServletResponse response,
            @ApiParam(value = "截止年月", required = true) @RequestParam String yearMonth);



}
